package com.framework.servlet;

import org.apache.commons.modeler.Registry;
import javax.management.MBeanServer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * @author LIN
 * @date 2022-09-11 22:14
 */
public class MyAdminServlet extends HttpServlet {

    private Registry registry;

    private MBeanServer mBeanServer;

    @Override
    public void init() throws ServletException{
        registry = (Registry) getServletContext().getAttribute("org.apache.catalina.Registry");
        if(registry == null){
            System.out.println("Registry not avaliable");
            return;
        }

        mBeanServer = (MBeanServer) getServletContext().getAttribute("org.apache.catalina.MBeanServer");
        if(mBeanServer == null){
            System.out.println("MBeanServer not avaliable");
            return;
        }
    }




}
